#include<cstdio>//uncle-lu
#include<algorithm>
template<class T>void read(T &x)
{
    x=0;bool f=false;char ch=getchar();
    while(ch<'0'||ch>'9') { f|=(ch=='-'); ch=getchar(); }
    while(ch<='9'&&ch>='0') { x = (x<<1) + (x<<3) + (ch^48); ch=getchar(); }
    x = f ? -x : x;
    return ;
}


int main()
{
    int f[4];
    int count(0);
    for(int i=0;i<4;++i)
    {
        read(f[i]);
        if(!f[i])count++;
    }

    if(count==1)
    {
        if (f[0] == 1)
            printf("YES\n0");
        else if (f[1] == 1)
            printf("YES\n1");
        else if (f[2] == 1)
            printf("YES\n2");
        else if (f[3] == 1)
            printf("YES\n3");
        else
            printf("NO");
    }
    else if(count == 2)
    {
        if( f[0]!=0 && f[2]!=0 )
            printf("NO");
        else if( f[1]!=0 && f[3]!=0 )
            printf("NO");
        else if( f[0]!=0 && f[3]!=0 )
            printf("NO");
        else if( f[0] != 0 && f[1] != 0)
        {

        }
    }

    return 0;
}